/**
 * ZHU framework. Copyright 2012-, all rights reserved.
 *
 * $Id: Lifecycle.java 16 2012-08-03 09:20:29Z zhuxiaopeng $
 * $Revision: 16 $
 * $Date: 2012-08-03 17:20:29 +0800 (五, 2012-08-03) $
 * $Author: zhuxiaopeng $
 */
package zhu.framework.entity.lifecycle;

import java.util.*;

import zhu.framework.entity.*;

/**
 * <p>
 * </p>
 * 
 * @author $Author: zhuxiaopeng $
 * @version $Revision: 16 $ - $Date: 2012-08-03 17:20:29 +0800 (五, 2012-08-03) $
 */
public interface Lifecycle<T extends Entity> {
	Class<T> getEntityType();

	T newInstance();

	T create(final T newEntity);

	T create(final EntityUpdator<T> updator);

	T update(final T entity, final EntityUpdator<T> updator);

	void remove(final T entity);

	T findById(final EntityId id);

	void removeAll(Collection<T> entityList);
}
